Admob reklam gelmiyor
Hata yok ama reklam gelmiyor
package com.winterstore;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.View.OnClickListener;
import android.webkit.WebSettings;
import android.webkit.WebSettings.LayoutAlgorithm;
import android.webkit.WebSettings.PluginState;
import android.webkit.WebSettings.TextSize;
import android.webkit.WebView;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.ScrollView;
import android.widget.TextView;
import com.google.android.gms.ads.AdRequest;
import com.google.android.gms.ads.AdView;
import com.google.android.gms.ads.*;
import com.ilginc.R;
import com.td.rssreader.parser.RSSFeed;
@SuppressWarnings("unused")
public class DetailFragment extends Fragment {
private int fPos;
RSSFeed fFeed;
public View onCreateView1(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
return inflater.inflate(R.layout.detail_fragment, container, false);
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
fFeed = (RSSFeed)getArguments().getSerializable("feed");
fPos = getArguments().getInt("pos");
}
public class MyActivity extends Activity {
private AdView mAdView;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
LinearLayout layout = new LinearLayout(this);
layout.setOrientation(LinearLayout.VERTICAL);
// Create a banner ad. The ad size and ad unit ID must be set before calling loadAd.
mAdView = new AdView(this);
mAdView.setAdSize(AdSize.SMART_BANNER);
mAdView.setAdUnitId("ca-app-pub-***************");
// Create an ad request.
AdRequest.Builder adRequestBuilder = new AdRequest.Builder();
// Optionally populate the ad request builder.
adRequestBuilder.addTestDevice(AdRequest.DEVICE_ID_EMULATOR);
// Add the AdView to the view hierarchy.
layout.addView(mAdView);
// Start loading the ad.
mAdView.loadAd(adRequestBuilder.build());
setContentView(layout);
}
@Override
public void onResume() {
super.onResume();
// Resume the AdView.
mAdView.resume();
}
@Override
public void onPause() {
// Pause the AdView.
mAdView.pause();
super.onPause();
}
@Override
public void onDestroy() {
// Destroy the AdView.
mAdView.destroy();
super.onDestroy();
}
}
@SuppressWarnings("deprecation")
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.detail_fragment, container, false);
// Initializr views
TextView title = (TextView)view.findViewById(R.id.title);
WebView desc = (WebView)view.findViewById(R.id.desc);
// Enable the vertical fading edge (by default it is disabled)
ScrollView sv = (ScrollView)view.findViewById(R.id.sv);
sv.setVerticalFadingEdgeEnabled(true);
// Set webview properties
WebSettings ws = desc.getSettings();
ws.setPluginState(PluginState.ON);
ws.setJavaScriptEnabled(true);
ws.setUseWideViewPort(true);
ws.setDefaultFontSize(25);
ws.setMinimumFontSize(10);
ws.setLoadWithOverviewMode(true);
ws.setLayoutAlgorithm(LayoutAlgorithm.SINGLE_COLUMN);
ws.setBuiltInZoomControls(false);
ws.setUserAgentString("Mozilla/5.0 (Linux; U; Android 2.0; en-us; Droid Build/ESD20) AppleWebKit/530.17 (KHTML, like Gecko) Version/4.0 Mobile Safari/530.17");
// Set the views
title.setText(fFeed.getItem(fPos).getTitle());
desc.loadDataWithBaseURL("http://www.androidcentral.com/", fFeed.getItem(fPos)
.getDescription(), "text/html", "UTF-8", null);
return view;
}
/**
* This class makes the ad request and loads the ad.
*/
}